﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Xml;

/// <summary>
/// A list of the event organizer
/// </summary>
public class Organizers : List<Organizer>
{
    public Organizers(XmlDocument XmlDocument)
	{
        foreach (XmlElement item in XmlDocument.DocumentElement)
        {
            Organizer o = new Organizer(item);
            base.Add(o);
        }
    }
}
/// <summary>
/// The event organizer
/// </summary>
public class Organizer
	{
        #region Organizer Arguments

        /// <summary>
        /// The organizer ID
        /// </summary>
        public int ID { get; set; }
        /// <summary>
        /// The organizer name
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// The organizer description
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// The organizer URL
        /// </summary>
        public string Url { get; set; }

        #endregion		

        internal Organizer(XmlElement XmlElement) { CreateOrganizer(XmlElement); }
        public Organizer(XmlDocument XmlDocument) { CreateOrganizer(XmlDocument.DocumentElement); }
        private void CreateOrganizer(XmlElement XmlElement)
        {
            foreach (XmlElement item in XmlElement)
            {
                switch (item.Name)
                {
                    case "id":
                        this.ID = Convert.ToInt32(item.InnerText);
                        break;
                    case "name":
                        this.Name = item.InnerText;
                        break;
                    case "description":
                        this.Description = item.InnerText;
                        break;
                    case "url":
                        this.Url = item.InnerText;
                        break;
                    default:
                        break;
                }
            }
        }
    }

